import request from '@/utils/request'

export function goodsPage(page,pageSize) {
    return request({
        url: '/service-mall/goods/getPage/' + page + "&" + pageSize,
        method: 'get',
    })
}

export function getGoods(id){
    return request({
        url: '/service-mall/goods/getGoods/'+ id,
        method: 'get'
    })
}

export function updateGoods(goods){
    return request({
        url: '/service-mall/goods/update',
        method: 'put',
        data: goods
    })
}

export function deleteGoods(id){
    return request({
        url: '/service-mall/goods/delete/'+id,
        method: 'delete',

    })
}

export function orderPage(page,pageSize){
    return request({
        url: '/service-mall/order/page/' + page + "&" + pageSize,

        method: 'get'
    })
}

export function getOrder(id){
    return request({
        url: '/service-mall/order/list/' + id,
        method: 'get'
    })
}

export function updateOrder(order) {
    return request({
        url: '/service-mall/order/update',
        method: 'put',
        order
    })
}

export function deleteOrder(id){
    return request({
        url: '/service-mall/order/delete/'+id,
        method: 'delete'
    })
}

export function uploadFile(multipartFile){
    return request({
        url: '/service-article/api/v1/news/upload_picture',
        method: 'post',
        headers: {'Content-Type': 'multipart/form-data'}, 
        data: multipartFile
    })
}